package com.niit.activity3_6.dao;


import com.niit.activity3_6.domain.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeeDao extends JpaRepository<Employee, String> {
    @Modifying
    @Query("update Employee e set e.name = ?2,e.gender=?3,e.title=?4 where e.id =?1")
    void updateEmployee(String id, String name, String gender, String title);
    @Query("from Employee e where e.gender=?1")
    List<Employee> findAllByGender(String gender);
}